var app = getApp();
const shareUtil = require('../../../utils/shareUtil.js');

Page({
    data: {
        imageurl: "",
        ad: {}
    },
    onLoad: function(e) {
        this.setData({
            imageurl: e.imageurl,
            ad: app.globalData.ad
        });
    },
    save: function() {
      if (1 != app.getJur()) {
        wx.saveImageToPhotosAlbum({
          filePath: this.data.imageurl,
          success: function(n) {
              wx.showToast({
                title: "保存成功"
              });
          },
          fail: function(n) {
              console.log("err:" + n), 
              wx.showToast({
                title: "保存失败",
                icon: "none"
              });
          }
        });
      }
    },
    previewImage: function(n) {
        var e = [];
        e.push(this.data.imageurl), wx.previewImage({
            current: e[0],
            urls: e
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage:shareUtil.shareConfig,
    onShareTimeline:shareUtil.shareConfig,
});